<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<span id="span" >这里是文字，可以点的</span>
<script>
var spanObj = document.getElementById('span');
function fun(){
    alert('tom')
}
spanObj.onclick = function(){
    var c = 'jack'
    alert('bb');

    fun();
}
</script>
</body>
</html>